home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93c.txt
/
000043_icon-group-sender _Tue Sep 7 09:30:57 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1994-02-02
|
1KB
Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 7 Sep 1993 08:23:43 MST
Received: by owl.cs.arizona.edu; Tue, 7 Sep 1993 08:23:42 MST
Message-Id: <9309071457.AA15180@relay2.UU.NET>
Subject: Re: return results
To: uunet!cs.arizona.edu!icon-group@uunet.uu.net (Icon News Group)
Date: Tue, 7 Sep 93 9:30:57 CDT
From: Jerry Nowlin <nowlin%isidev@uunet.uu.net>
X-Mailer: ELM [version 2.3 PL11]
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
> I've been using Icon for seberal years now, but recently I stumbled across a
> 'problem' for the fist time - I wanted to return more than one result from a
> procedure (yup - strange to relate, after several years I had never needed to
> do this before).
>
> What I want to know is "what is the 'best' way to return several results from
> a procedure?'. One obvious way to do it is to use a list:
>
> procedure myproc
> .
> list_of_results:=[]
> .
> .
> list_of_results[1]:=...
> list_of_results[2]:=...
> .
> .
> return list_of_results
> end
>
> but I guess that one could use a record.
>
> Any thoughts on which is best?
>
> Thanks.
>
> Roger Hare
It sounds like you should turn your procedure into a generator. That's
the iconish (sic) way to return more than one result from a procedure.
When the list of results is exhausted the procedure fails.
Jerry Nowlin
uunet!isidev!nowlin (uucp)
isidev!nowlin@uunet.uu.net (internet)